// Copyright [2020] <unknown>
#include <bits/stdc++.h>
using namespace std;
// #define ONLINE_JUDGE
#ifndef ONLINE_JUDGE
#define dbg(x...) { cerr << "\033[32;1m" << #x << " -> "; err(x); }
void err() { cerr << "\033[39;0m" << endl; }
template<typename T, typename... A>
void err(T a, A... x) { cerr << a << ' '; err(x...); }
#else
#define dbg(...)
#endif

#define sz(x) ((int)x.size())

typedef long long LL;

LL bin(LL a, LL b, LL p) {
	LL res = 1;
	for (a%=p; b; b>>=1, a=a*a%p)
		if (b & 1)
			res = res * a % p;
	return res;
}

const int N = 1e5+50;
int n;

vector<int> G[N];

bool has[N][2];


bool leaf[N], side[N];
void dfs(int u, int fa) {
	if (leaf[u]) {
		has[u][0] = 1;
	}

	for (int v : G[u]) {
		if (v == fa)
			continue;
		dfs(v, u);
		has[u][0] |= has[v][1];
		has[u][1] |= has[v][0];
	}
}

int main(int argc, char const *argv[]) {
    // code
    scanf("%d", &n);
    for (int i=0; i<n-1; ++i) {
    	int u, v;
    	scanf("%d%d", &u, &v);
    	G[u].push_back(v);
    	G[v].push_back(u);
    }

    for (int i=1; i<=n; ++i)
    	if (sz(G[i]) == 1)
    		leaf[i] = 1;
    int f1 = 0, f2 = 0;
    for (int i=1; i<=n; ++i) {
    	for (int v : G[i]) {
    		if (leaf[v] && !leaf[i])
    			side[i] = 1;
    	}
    	// dbg(i, side[i]);
    }
    for (int i=1; i<=n; ++i)
    	f2 += side[i];
    f2 += n-1;
    for (int i=1; i<=n; ++i)
    	f2 -= leaf[i];
    f1 = 1;
    dfs(1, 1);
    // for (int i=1; i<=n; ++i)
    // 	dbg(i, has[i][0], has[i][1], leaf[i]);
    for (int i=1; i<=n; ++i)
    	if (has[i][0] && has[i][1])
    		f1 = 3;
    printf("%d %d\n", f1, f2);


    return 0;
}